'''
#字典的增加
dict1={'name':'marry','age':18}
dict1['name']='tom'
dict1['id']=100
print(dict1)
#字典的删除
dict1={'name':'xiaoming','age':18,'id':1}
#print(dict1['name'])
#dict1.clear()
#print(dict1)

#del (dict1)
del dict1['name'or'id']
print(dict1)

#字典修改
dict1={'[name':'marry','age':19,'id':18}
dict1['id']=10
print(dict1)

#字典查找
#dict1={'name':'marry','age':19,'id':18}

#1,[key]
#print(dict1['name'])

#2,函数
#2.1,get
#print(dict1.get('name'))
#print(dict1.get('names'))  #如果key不存在，返回none
#print(dict1.get('name'))
#print(dict1.get('names','lisa'))  #如果key不存在，返回后面的字符

#2.2,keys() 查找字典中的所有的key，返回可迭代对象
#print(dict1.keys())

#2.3,values() 查找字典中的所有的value，返回可迭代对象
#print(dict1.values())

#2.4,items() 查找字典中的所有的键值对，输出的元组，返回可迭代对象
#print(dict1.items())


